import { store } from "/@/store";
import { defineStore } from "pinia";

interface AwardStaffSelectDO {
  staffId: number | null;
  startTime: Date | null;
  endTime: Date | null;
}

export const useAwardStore = defineStore({
  id: "pure-award",
  state: (): AwardStaffSelectDO => ({
    staffId: null,
    startTime: null,
    endTime: null
  }),
  actions: {
    setAwardSelect(value: AwardStaffSelectDO) {
      this.staffId = value.staffId;
      this.startTime = value.startTime;
      this.endTime = value.endTime;
    },
    setStaffId(value: number) {
      this.staffId = value;
    },
    setStartTime(value: Date) {
      this.startTime = value;
    },
    setEndTime(value: Date) {
      this.endTime = value;
    }
  }
});

export function useAwardStoreHook() {
  return useAwardStore(store);
}
